package game.metalmax.factory
{
	public final class AbstractFactory
	{
		private static var sobFactory:SOBFactory = null;
		
		private static var itemFactory:ItemFactory = null;
		
		public static function getFactory(clazz:Class):IFactory
		{
			switch (clazz)
			{
				case SOBFactory:
				{					
					if (sobFactory == null)
					{
						sobFactory = new SOBFactory();
					}
					 
					return sobFactory;
				}
				case ItemFactory:
				{
					if (itemFactory == null)
					{
						itemFactory = new ItemFactory();
					}
					
					return itemFactory;
				}
				default:
				{
					return null;
				}
			}

		}
	}
}